package com.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@TableName("news_remark")
public class Comment {

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("userid")
    private Integer userid;

    @ApiModelProperty("创建时间")
//    @JsonFormat(pattern = "yyyy-MM-dd")
    private String time;

    @ApiModelProperty("评论内容")
    private String content;

    @ApiModelProperty("点赞")
    private Integer isLiked;

    @ApiModelProperty("点赞次数")
    private Integer likeCount;

    @ApiModelProperty("新闻id")
    private Integer channelId;

    @ApiModelProperty("最上级评论id")
    private Integer originId;

    private Integer pid;

    @TableField(exist = false) //表示在数据库表中没有
    private List<Comment> children;

    @TableField(exist = false)
    private String pNickname;  //父节点的用户名称

    @TableField(exist = false)
    private Integer pUserId; //父节点的用户id

    @TableField(exist = false)
    private String nickname;

    @TableField(exist = false)
    private String avatarUrl;

}
